<template>
    <ul v-if="newestArr" @click="$emit('play-list',newestArr)">
        <NewestItem :songId="songId" v-for="item in newestArr" :key="item.id" :item="item" @play-audio="$emit('play-audio',$event)" :playing="playing" />
    </ul>
</template>

<script>
    import NewestItem from '@/components/NewestItem.vue'
    export default {
        props:{
            songId:Number,
            playing:Boolean,
        },
        components:{
            NewestItem
        },
        data(){
            return{
                newestArr:[]
            }
        },
        created(){
            this.axios.get('https://apis.netstart.cn/music/personalized/newsong').then(res => {
                this.newestArr = res.data.result;
            })
        }
    }
</script>

<style lang="less" scoped>

</style>